<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>产房建卡</title>
<meta name="decorator" content="default"/>
<script src="${ctxStatic}/common/change/change.js"></script>
<script src="${ctxStatic}/common/check/check.js"></script>
<script src="${ctxStatic}/art-template-4.12.1/lib/template-web.js" type="text/javascript" ></script>


<style type="text/css">
	#selectVaccTable{
		margin: 10px;
	}
	.td-batch{ position: relative;}
	.hisList{ 
		border: 1px solid #ccc;
		border-top: none;
		background-color: #fff;
	    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
	    -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
	    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
	    -webkit-transition: border linear .2s, box-shadow linear .2s;
	    -moz-transition: border linear .2s, box-shadow linear .2s;
	    -o-transition: border linear .2s, box-shadow linear .2s;
	    transition: border linear .2s, box-shadow linear .2s;
	    position: absolute;
     	top: 34px;
     	z-index: 999;
    }
    .hisList p{ padding: 4px 6px; margin: 0;}
	.hisList p:hover{ background: #CCCCCC; }
	.none{ display: none;}
	
</style>

<script type="text/javascript" src="${ctxStatic}/jQueryDistpicker20160621/dist/distpicker.data.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/jQueryDistpicker20160621/dist/distpicker.js"></script>

<script id="selectVaccFormTpl" type="text/html">
	<table class="selectVaccTable table table-bordered table-hover table-condensed">
		<thead>
			<tr>
				<th>序号</th>
				<th>疫苗</th>
				<th>厂商</th>
				<th>批号</th>
				<th>有效期</th>
				<th>剂量</th>
				<th>剂型</th>
				<th>库存</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			{{each list as value i}}
			<tr data-data={{value.data}} data-idx='{{value.idx}}'>
				<td>{{i+1}}</td>
				<td>{{value.vaccineName}}</td>
				<td>{{value.companyName}}</td>
				<td>{{value.batchno}}</td>
				<td>{{value.outBoundDate}}</td>
				<td>{{value.dose}}</td>
				<td>{{value.customBillNo}}</td>
				<td>{{value.stroeNum}}</td>
				<td><button type="button" class="btn btn-mini btn-primary" onclick="choseVacc(this)">选择</button></td>
			</tr>
			{{/each}}
		</tbody>
	</table>
</script>

<script type="text/javascript">

	var batchVaccList = [];
	var communityList = [];
	var histroyList = new Array();
	var HISTROY_KEY = "HISTROY_KEY";
	
	var records = '${fns:toJson(childBaseinfoTemp.records)}';
	if(records){
		records = JSON.parse(records);
	}
	//居住地址回显数据
	var childTempProvince = '${fns:toJson(childBaseinfoTemp.province)}';
	var childTempCity = '${fns:toJson(childBaseinfoTemp.city)}';
	var childTempCounty = '${fns:toJson(childBaseinfoTemp.county)}';
	var childTempCommunity = '${fns:toJson(childBaseinfoTemp.community)}';
	if(childTempProvince || childTempCity || childTempCounty){
		childTempProvince = JSON.parse(childTempProvince);
		childTempCity = JSON.parse(childTempCity);
		childTempCounty = JSON.parse(childTempCounty);
		childTempCommunity = JSON.parse(childTempCommunity);
	}
	
	//户籍地址回显数据
	var childTempPr = '${fns:toJson(childBaseinfoTemp.pr)}';
	var childTempCi = '${fns:toJson(childBaseinfoTemp.ci)}';
	var childTempCo = '${fns:toJson(childBaseinfoTemp.co)}';
	if(childTempPr || childTempCi || childTempCo){
		childTempPr = JSON.parse(childTempPr);
		childTempCi = JSON.parse(childTempCi);
		childTempCo = JSON.parse(childTempCo);
	}
	
	/* 保存数据localStorage */
	function saveHistroyList(){
		localStorage.setItem(HISTROY_KEY, JSON.stringify(histroyList));
	}
	
	$(function(){
		
		//debugger
		if(localStorage.getItem(HISTROY_KEY)){
			histroyList = JSON.parse(localStorage.getItem(HISTROY_KEY));
		}
	
		$("#inputForm").validate({
			submitHandler: function(form){
				postOrderDetil(form);
			}
		});
		
		/*查看告知书*/
		$(".seeInfo").click(function(){
			var signature = window.localStorage.getItem("signature");
			if(!signature){
				layer.alert("该自主建档未签字或先输入微信自助建档编号，查询自助建档档案！");
			}else{
				seeInfo();
			}
		});
		
		/* 加载建卡信息 */
		$("#buildCardCode").keypress(function(event){
			var index = layer.load();
			var code = $(this).val();
			
			if(event.keyCode == 13){
				window.localStorage.setItem("signature",'');
				$.ajax({
					url:ctx + "/born/childBaseinfoTemp/queryChildInfoFromWx",
					data:{"code":code},
					async: true,
					success:function(data){
						layer.close(index);
						console.info("加载成功");
						if(data.success){
							layer.close();
							
							var signature = data.data.signature;//签字
							if(!signature){
								//$("#signatureCode").val("");
								layer.alert("该建档无签字，请重新建档！");
								return;
							}else{
								//$("#signatureCode").val("");
								$("#signature").val(signature);
								window.localStorage.setItem("signature",signature);
							}
							
							$("#childname").val(data.data.childname);
							$("#birthcode").val(data.data.birthcode);
							$("input.gender[value=" + data.data.gender + "]").prop("checked",true);
							$("#birthday").val(data.data.birthday);
							$("#birthweight").val(data.data.birthweight);
							$("#childorder").val(data.data.childorder);
							$("#nation").val(data.data.nation).select2();
							$("#guardianname").val(data.data.guardianname);
							$("#guardianmobile").val(data.data.guardianmobile);
							$("#guardianidentificationnumber").val(data.data.guardianidentificationnumber);
							$("#father").val(data.data.father);
							$("#fathercard").val(data.data.fathercard);
							$("#fatherphone").val(data.data.fatherphone);
							$("#pr").val(data.data.pr).select2().change();
							$("#ci").val(data.data.ci).select2().change();
							$("#co").val(data.data.co).select2();
							$("#add").val(data.data.add);
							$("#province").val(data.data.province).select2().change();
							$("#city").val(data.data.city).select2().change();
							$("#county").val(data.data.county).select2();
							/* html = "<option value='"+communityData[i].id+"' data-name='"+communityData[i].name+"' data-code='"+communityData[i].id+"'>"+communityData[i].name+"</option>";
							$("#community").append(html); */
							$.ajax({
								url:ctx + "/born/childBaseinfoTemp/community",
								data:{"parentId":data.data.county},
								async:false, 
								success:function(data){
									var communityData = data;
									if(communityData.length > 0){
										var html = null;
										for(var i in communityData){
											html = "<option value='"+communityData[i].id+"' data-name='"+communityData[i].name+"' data-code='"+communityData[i].id+"'>"+communityData[i].name+"</option>";
											$("#community").append(html);
										} 
									}
								}
							});
							/* $("#community").val(data.data.community).select2(); */
							$("#addressStr").find("#community").val(data.data.community).select2();
							$("#village").val(data.data.village);
							$("#address").val(data.data.address);
							$("#properties").val(data.data.properties).select2();
							$("#reside").val(data.data.reside).select2();
							$("#homeAddressAll").val($("#province option:selected").html() + $("#city option:selected").html() + $("#county option:selected").html() + $("#community option:selected").html() + $("#address").val());
							$("#regAddressAll").val($("#pr option:selected").html() + $("#ci option:selected").html() + $("#co option:selected").html() + $("#add").val());
							$("#localcode").val(data.data.localcode);
						}
						console.info(data);
					},error:function(a,b,c){
						layer.close(index);
						console.error("请求建卡数据失败");
					}
				});
				return false;
			}
		});
		
		/*查询批号信息*/
		$(".batch").keypress(function(event){
			debugger;
			if(event.keyCode == 13){
				var _this = $(this);
				var batch = _this.val();
				var idx = _this.parent().parent().attr("data-idx");
				
				/* 文本框记忆功能 */
				$(".hisList").hide();
				_this.css("border-radius","4px");
				if(batch){
					setTopValue(histroyList, batch);
					saveHistroyList();
					if(histroyList.length > 6){
						histroyList.splice(0,1);
						saveHistroyList();
					}
				}
				
				/* 文本框记忆功能  END*/
				$.ajax({
					url:ctx + "/born/childBaseinfoTemp/bornVaccExis",
					data:{"batchno":batch},
					success:function(data){
						batchVaccList = batchVaccList.concat(data);
						if(data.length == 0){
							alert("疫苗批号不存在");
						}else if(data.length == 1){
							initTableValue(idx, data[0]);
						}else{
							for(var i in data){
								data[i]["data"] = JSON.stringify(data[i]);
								data[i]["idx"] = _this.parent().parent().attr("data-idx");
							}
							var html = template('selectVaccFormTpl', {'list':data});
							layer.close(layer.index);
							layer.open({
								type:'1',
								title :'选择疫苗',
								shade :0.3,
								content:html,
								area: ['800px', '400px'],
								cancel:function(){
									
								}
								
							});
						}
						console.info("加载批号成功");
						console.info(data);
					}
				});
			return false;
			}
		});
		
		/* 加载全部社区*/
		$("#county").change(function(){
			$("#comOption").nextAll().remove();
			var countyCode = $("#county").val();
			$.ajax({
				url:ctx + "/born/childBaseinfoTemp/community",
				data:{"parentId":countyCode},
				async:true, 
				success:function(data){
					var communityData = data;
					if(communityData.length > 0){
						var html = null;
						for(var i in communityData){
							html = "<option value='"+communityData[i].id+"' data-name='"+communityData[i].name+"' data-code='"+communityData[i].id+"'>"+communityData[i].name+"</option>";
							$("#community").append(html);
						} 
					}
				}
			});
		});
		
		$(".reg-address-wrap").distpicker();
		$(".home-address-wrap").distpicker();
		
		
		/* 疫苗批号文本框记忆历史记录功能 */
		$(".batch").focus(function(){
			//debugger
			var $_thisHistroy = $(this).siblings(".hisList");
			$_thisHistroy.empty();
			for(var i in histroyList){
				$_thisHistroy.prepend('<p>'+ histroyList[i] +'</p>');
			}
			var hisListWidth = $(this).width() + 12;
			$(this).css("border-radius","4px 4px 0 0");
			$_thisHistroy.css("width",hisListWidth).show();
		});
		
		$(".batch").blur(function(){
			$(this).siblings(".hisList").slideUp();
			$(this).css("border-radius","4px");
		});
		
		/* $("#batch1").select(function(){
			var batchnoStr = $(this).val();
			var twobt = $("#batch2").val();
			var threebt = $("#batch3").val();
			if((batchnoStr==twobt) || (batchnoStr==threebt)){
				alert("该批号疫苗已选择！");
			}
		}); */
		
		$(document).on("click",".hisList p",function(){
			//debugger
			setTopValue(histroyList, $(this).html());
			$(this).parent().siblings(".batch").val($(this).html()).focus();
			return false;
		});
		
		/* 修改建档数据时 回显接种记录 */
		if(records && records.length > 0){
			//debugger
			/* for(var i in records){
				altTableValue(i+1,records[i]);
			} */
			for(var i=1;i<records.length+1;i++){
				altTableValue(i,records[i-1]);
			}
		}
		
		/* 户籍、家庭地址回显数据*/
		altAdressValue(childTempProvince,childTempCity,childTempCounty);
		altHouseholdValue(childTempPr,childTempCi,childTempCo);
		if(childTempCommunity != 0){
			altCommnity(childTempCommunity);
		}
		
		
		/*重置*/
		$("#btnReset").click(function(){
			//debugger
			$("#childname").val("");
			$("#birthcode").val("");
			$("#birthday").val("");
			$("#birthweight").val("");
			$("#childorder").val("");
			$("#nation").val("").select2();
			$("#guardianname").val("");
			$("#guardianmobile").val("");
			$("#guardianidentificationnumber").val("");
			$("#father").val("");
			$("#fathercard").val("");
			$("#fatherphone").val("");
			$("#pr").val("").select2().change();
			$("#ci").val("").select2().change();
			$("#co").val("").select2();
			$("#add").val("");
			$("#province").val("").select2().change();
			$("#city").val("").select2().change();
			$("#county").val("").select2();
			$("#village").val("");
			$("#address").val("");
			$("#properties").val("").select2();
			$("#reside").val("").select2();
		});
	});
	
	/*查看告知书*/
	function seeInfo(){
		alertForm(ctx + "/born/childBaseinfoTemp/toSignature", "告知书", '1500', '800', {
			//shade: 0
		});
	}
	
	/*修改建档时，回显户籍地址*/
	function altHouseholdValue(pr,ci,co){
		var _householdStr = $("#household");
		_householdStr.find("#pr").val(pr).select2().change();
		_householdStr.find("#ci").val(ci).select2().change();
		_householdStr.find("#co").val(co).select2();
	}
	
	/*修改建档时，回显家庭地址*/
	function altAdressValue(province,city,county){
		var _addressStr = $("#addressStr");
		_addressStr.find("#province").val(province).select2().change();
		_addressStr.find("#city").val(city).select2().change();
		_addressStr.find("#county").val(county).select2();
	}
	
	/*加载回显社区信息*/
	function altCommnity(code){
		var countyCode = $("#county").val();
		$.ajax({
			url:ctx + "/born/childBaseinfoTemp/community",
			data:{"parentId":countyCode},
			success:function(data){
				var communityData = data;
				if(communityData.length>0){
					var html = null;
					for(var i in communityData){
						html = "<option value='"+communityData[i].id+"' data-name='"+communityData[i].name+"' data-code='"+communityData[i].id+"'>"+communityData[i].name+"</option>";
						$("#community").append(html);
						$("#addressStr").find("#community").val(code).select2();
					}
				}
			}
		});
	}
	
	/* 新增时增加接种记录 */
	function initTableValue(idx, data){ 
		var _tr = $("#vac-table>tbody>tr[data-idx=" + idx + "]");
		_tr.find(".td-vaccName").html(data.vaccineName);
		_tr.find(".batch").val(data.batchno);
		_tr.find(".td-vaccExpDate").html(data.outBoundDate);
		_tr.find(".td-manufacturer").html(data.companyName);
		_tr.find(".batchId").val(data.id);
		_tr.find(".vaccineId").val(data.vaccineId);
	}
	
	/* 修改时增加接种记录 */
	function altTableValue(idx, data){ 
		var _tr = $("#vac-table>tbody>tr[data-idx=" + idx + "]");
		_tr.find(".td-vaccName").html(data.vaccName);
		_tr.find(".batch").val(data.batch);//疫苗批号
		_tr.find(".td-vaccExpDate").html(data.vaccExpDate);
		_tr.find(".td-manufacturer").html(data.manufacturer);
		_tr.find(".vaccineid").val(data.vaccineid);
		//_tr.find(".batchId").val(data.id);
		_tr.find(".doctor").val(data.doctor);
		//_tr.find(".remarks").val(data.remarks);
		_tr.find("#vaccinatedate").val(data.vaccinatedate);
		_tr.find("option[name=bodypart]").val(data.bodypart);
	}

	function choseVacc(thi){
		_this = $(thi);
		_tr = _this.parent().parent();
		var data = _tr.attr("data-data");
		var idx = _tr.attr("data-idx");
		if(data){
			data = JSON.parse(data);
			initTableValue(idx, data);
		}
		layer.closeAll();
	}
	
	function delRow(idx){
		_tr = $("#vac-table > tbody > tr[data-idx=" + idx + "]")
		_tr.find("input").val('');
		_tr.find(".lab").html('');
	}
	
	/*表单保存时  将此方法中的数据尽行保存*/
	function postOrderDetil(form) {
		
		var vacList = [];
		for(var i = 0; i < $(".batch").length; i ++){
			_batch = $(".batch").eq(i);
			if(!_batch.val()){
				continue;
			}
			var vac = new Object();
			_tr = _batch.parent().parent();
			vac["vaccBigname"]=_tr.find(".td-vaccName").html();
			vac["vaccName"] = _tr.find(".td-vaccName").html();//疫苗名称
			vac["batch"] = _tr.find(".batch").val();//疫苗批号
			vac["vaccExpDate"] = _tr.find(".td-vaccExpDate").html();//有效期
			vac["manufacturer"] = _tr.find(".td-manufacturer").html();//生产企业
			vac["vaccinatedate"] = _tr.find(".vaccinatedate").val();//疫苗接种日期
			vac["bodypart"] = _tr.find("select.bodypart").val();//疫苗接种部位
			vac["localcode"] = _tr.find("td-localcode").val();//接种单位
			vac["doctor"] = _tr.find(".doctor").val();//接种人员
			vac["batchId"] = _tr.find(".batchId").val();//疫苗Id
			vac["vaccineid"] = _tr.find(".vaccineId").val();//疫苗Id
			//vac["remarks"] = _tr.find(".remarks").val()//备注
			//接种记录初始值
			vac["dosage"] = '1';//默认针次
			vac["office"] = '${fns:getUser().office.code}';
			vac["localcode"] = '${fns:getUser().office.code}';
			vac["birthhostipal"] = '${fns:getUser().office.code}';
			vac["status"] = '1';//状态1已完成
			vac["sign"] = '1';
			vac["source"] = '3';//来源3补录
			vac["vacctype"] = '0';//接种类型0常规
			vac["signature"] = '0';//接种类型0常规
			
			vacList.push(vac);
			/* for(var j in batchVaccList){
				if(batchVaccList[j].id == vac["batchId"]){
					vac["vaccineid"] = batchVaccList[j].vaccineId;
					vac["vaccBigname"] = batchVaccList[j].vaccineName;
					vac["vaccName"] = batchVaccList[j].vaccineName;
					vac["manufacturer"] = batchVaccList[j].companyName;
					vac["manufacturercode"] = batchVaccList[j].companyCode;
					vac["nid"] = batchVaccList[j].vaccineId.substr(0,2)+'1';
					vac["vaccExpDate"] = batchVaccList[j].outBoundDate;
					vac["batch"] = batchVaccList[j].batchno;
					break;
				}
			} */
			
			$("#homeAddressAll").val($("#province option:selected").html() + $("#city option:selected").html() + $("#county option:selected").html() + $("#community option:selected").html() + $("#address").val());
			$("#regAddressAll").val($("#pr option:selected").html() + $("#ci option:selected").html() + $("#co option:selected").html() + $("#add").val());
		}
		
		if(vacList.length == 0){
			/* alert("未接种疫苗") */
			if(!$("#remarks").val()){
				alert("如未能完成接种，请注明原因");
				return false;
			}
		}
		
		layer.confirm('确定保存？', {
			icon: 3, title:'提示',
			btn : [ '保存', '取消' ]
		/*按钮*/
		}, function() {
			$("#records").val(JSON.stringify(vacList));
			layer.load(2);
			loading('正在提交，请稍等...');
			form.submit();
		});
	}

</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="##">产房建卡新增</a>
		</li>
		<li>
			<a href="${ctx}/born/childBaseinfoTemp/">建卡列表</a>
		</li>
	</ul>
	<br/>
	<form:form id="inputForm" modelAttribute="childBaseinfoTemp"  action="${ctx}/born/childBaseinfoTemp/saveReferral" method="post" class="form-horizontal">
	<input type="hidden" id="records" name="records">
	<input type="hidden" id="localcode" name="localcode" />
	<input type="hidden" id="signature" name="signature" />
	<form:hidden path="id"/>
	<sys:message content="${message}"/>
	<div class="container-fluid">

	<div class="row-fluid">
		<div class="control-group span6 minWidth">
			<label class="control-label">建卡编号：</label>
			<div class="controls">
				<input type="text" id="buildCardCode" name="buildCardCode" value="" class="span7" placeholder="请输入微信自助建卡后4位建卡编号" />
				<span class="help-inline"  style="color: red;">输入完毕后回车可自动填入信息</span>
			</div>
		</div>
	</div>	
	
    <div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>儿童姓名：</label>
			<div class="controls">
				<input type="text" id="childname" name="childname" value="${childBaseinfoTemp.childname}" class="span7 required"/>
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label">出生证号：</label>
			<div class="controls">
				<input type="text" id="birthcode" name="birthcode" value="${childBaseinfoTemp.birthcode}" class="span7"/>
			</div>
		</div>
	</div>
    <div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>性别：</label>
			<div class="controls">
				<form:radiobuttons path="gender" items="${fns:getDictList('sex')}" itemLabel="label" itemValue="value" class="input-medium gender"/>
				<span class="help-inline"><font color="red">*</font></span>
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>出生日期：</label>
			<div class="controls">
				<input id="birthday" name="birthday" type="text" readonly="readonly" maxlength="20" class="span7 Wdate required" 
				pattern="yyyy-MM-dd HH:mm:ss" value="<fmt:formatDate value="${childBaseinfoTemp.birthday}" pattern="yyyy-MM-dd"/>"
				onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
			</div>
		</div>
	</div>
    <div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>体重：</label>
			<div class="controls">
				<input type="text" id="birthweight" name="birthweight" value="${childBaseinfoTemp.birthweight}" class="span7 required number"  placeholder="请填写体重，单位克"  />
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>胎次：</label>
			<div class="controls">
				<input type="text" id="childorder" name="childorder" value="${childBaseinfoTemp.childorder}" class="span7 required number" placeholder="请填写胎次，如”1“" />
			</div>
		</div>
	</div>
    <div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label">出生医院：</label>
			<div class="controls">
				<select id="birthhospital" name="birthhospital" class="span7 required">
					<option value="${fns:getUser().office.code}">${fns:getUser().office.name}</option>
				</select>
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>民族：</label>
			<div class="controls">
				<form:select id="nation" path="nation" class="span7 form-control ">
							<form:options items="${fns:getDictList('nation') }" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
	</div>
	<div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>母亲姓名：</label>
			<div class="controls">
				<input type="text" id="guardianname" name="guardianname" value="${childBaseinfoTemp.guardianname}" class="span7 required" />
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label">父亲姓名：</label>
			<div class="controls">
				<input type="text" id="father" name="father" value="${childBaseinfoTemp.father}" class="span7" />
			</div>
		</div>
	</div>
	<div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>母亲身份证：</label>
			<div class="controls">
				<input type="text" id="guardianidentificationnumber" name="guardianidentificationnumber" value="${childBaseinfoTemp.guardianidentificationnumber}" class="span7 required card" />
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label">父亲身份证：</label>
			<div class="controls">
				<input type="text" id="fathercard" name="fathercard" value="${childBaseinfoTemp.fathercard}" class="span7 card" />
			</div>
		</div>
	</div>
	<div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>母亲电话：</label>
			<div class="controls">
				<input type="text" id="guardianmobile" name="guardianmobile"  value="${childBaseinfoTemp.guardianmobile}" maxlength="11" class="span7 required mobile" />
			</div>
		</div>
		
		<div class="control-group span6 minWidth">
			<label class="control-label">父亲电话：</label>
			<div class="controls">
				<input type="text" id="fatherphone" name="fatherphone" value="${childBaseinfoTemp.fatherphone}" maxlength="11" class="span7 mobile" />
			</div>
		</div>
	</div>
	
	  	<div class="row-fluid">
        <div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>户口类别：</label>
			<div class="controls">
			    <form:select id="properties" path="properties" class="span7 form-control ">
					<form:options items="${fns:getDictList('properties') }" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
		<div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>居住属性：</label>
			<div class="controls">
				<form:select id="reside" path="reside" class="span7 form-control ">
					<form:options items="${fns:getDictList('reside') }" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>
	</div>
	
	<div class="row-fluid">
		<div class="control-group span6 minWidth">
			<label class="control-label"><font color="red">*</font>家庭住址：</label>
			<div id="addressStr" class="controls home-address-wrap">
				<select id="province" name="province" class="addr-input" style="min-width: 120px;"></select>
				<label>省</label>
				<select id="city" name="city" class="addr-input" style="min-width: 120px;"></select>
				<label>市</label>
				<select id="county" name="county" class="addr-input" style="min-width: 120px;"></select>
				<label>区</label>
				<br>
				<br>
				<select id="community" name="community" class="addr-input" style="min-width: 120px;border-top-width: -5;border-top-width: 10px;margin-top: 0px;margin-bottom: 10px;">
				<option id="comOption" value="" data-name="" data-code=""></option>
				</select>
				<label>社区</label>
				<br>
				<input type="text" id="address" name="address" value="${childBaseinfoTemp.address}"  class="span7 required mt10" maxlength="100" placeholder="请输入家庭详细地址" />
			</div>
			<input type="hidden" id="homeAddressAll" name="homeAddressAll" value=""/>
		</div>
	
        <div class="control-group span6 minWidth" style="padding-bottom: 28px;">
			<label class="control-label">户籍地址：</label>
			<div id="household" class="controls reg-address-wrap">
				<select id="pr" name="pr" class="required" style="min-width: 120px;"></select>
				<label>省</label>
				<select id="ci" name="ci" class="" style="min-width: 120px;"></select>
				<label>市</label>
				<select id="co" name="co" class="" style="min-width: 120px;"></select>
				<label>区</label>
				<br>
				<input type="text" id="add" name="add" value="${childBaseinfoTemp.add}" class="span7 mt10"  maxlength="100" placeholder="请输入户籍详细地址" />
				<br>
				<br>
				<br>
			</div>
			<input type="hidden" id="regAddressAll" name="regAddressAll" value=""/>
		</div>
	</div>	

	<div class="row-fluid">
        <div class="control-group">
        <p style="color: red;">①：点击填写疫苗批号并回车；&emsp;②：选择疫苗；&emsp;③：选择接种日期、接种部位，填写接种人员</p>
        	<table id="vac-table" class="table table-bordered table-condensed">
				<thead>
					<tr>
						<th>疫苗名称</th>
						<th>疫苗批号</th>
						<th>有效期</th>
						<th>生产企业</th>
						<th>接种日期</th>
						<th>接种部位</th>
						<th>接种单位</th>
						<th>接种人员</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<tr data-idx=1>
						<td class="td-vaccName lab"></td>
						<td class="td-batch">
							<input type="text" id="batch1" class="batch" value=""/>
							<input type="hidden" class="batchId"/>
							<input type="hidden" class="vaccineId"/>
							<div class="hisList none"></div>
						</td>
						<td class="td-vaccExpDate lab"></td>
						<td class="td-manufacturer lab"></td>
						<td class="td-vaccinatedate">
							<input id="vaccinatedate" type="text" maxlength="20" class="Wdate vaccinatedate"
								value="<fmt:formatDate value="${newDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
						</td>
						<td class="td-bodypart">
							<select class="bodypart">
								<c:forEach items="${fns:getDictList('position') }" var='dict'>
									<option value="${dict.value }">${dict.label }</option>
								</c:forEach>
							</select>
						</td>
						<td class="td-localcode">
							${fns:getUser().office.name}
						</td>
						<td class="td-doctor">
							<input type="text" class="doctor" value="${doctor}"/>
						</td>
						<td class="td-option">
						<button type="button" onclick="delRow(1)">清空</button>
						<button type="button" class="seeInfo">查看告知书</button>
						</td>
					</tr>
					<tr data-idx=2>
						<td class="td-vaccName lab"></td>
						<td class="td-batch">
							<input type="text" id="batch2" class="batch" value=""/>
							<input type="hidden" class="batchId"/>
							<input type="hidden" class="vaccineId"/>
							<div class="hisList none"></div>
						</td>
						<td class="td-vaccExpDate lab"></td>
						<td class="td-manufacturer lab"></td>
						<td class="td-vaccinatedate">
							<input id="vaccinatedate" type="text" maxlength="20" class="Wdate vaccinatedate"
								value="<fmt:formatDate value="${newDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
						</td>
						<td class="td-bodypart">
							<select class="bodypart">
								<c:forEach items="${fns:getDictList('position') }" var='dict'>
									<option value="${dict.value }">${dict.label }</option>
								</c:forEach>
							</select>
						</td>
						<td class="td-localcode">
							${fns:getUser().office.name}
						</td>
						<td class="td-doctor">
							<input type="text" class="doctor" value="${doctor}"/>
						</td>
						<td class="td-option">
						<button type="button" onclick="delRow(2)">清空</button>
						<button type="button" class="seeInfo">查看告知书</button>
						</td>
					</tr>					
					<tr data-idx=3>
						<td class="td-vaccName lab"></td>
						<td class="td-batch">
							<input type="text" id="batch3" class="batch" value=""/>
							<input type="hidden" class="batchId"/>
							<input type="hidden" class="vaccineId"/>
							<div class="hisList none"></div>
						</td>
						<td class="td-vaccExpDate lab"></td>
						<td class="td-manufacturer lab"></td>
						<td class="td-vaccinatedate">
							<input id="vaccinatedate" type="text" maxlength="20" class="Wdate vaccinatedate"
								value="<fmt:formatDate value="${newDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
						</td>
						<td class="td-bodypart">
							<select class="bodypart">
								<c:forEach items="${fns:getDictList('position') }" var='dict'>
									<option value="${dict.value }">${dict.label }</option>
								</c:forEach>
							</select>
						</td>
						<td class="td-localcode">
							${fns:getUser().office.name}
						</td>
						<td class="td-doctor">
							<input type="text" class="doctor" value="${doctor}"/>
						</td>
						<td class="td-option">
						<button type="button" onclick="delRow(3)">清空</button>
						<button type="button" class="seeInfo">查看告知书</button>
						</td>
						
					</tr>
				</tbody>
			</table>
        </div>
	    </div>
	<div class="row-fluid">
        <div class="control-group span12 minWidth">
			<label class="control-label" style="width: 200px; text-align: left; color: red; font-weight: 700;">如未能完成接种，请注明原因：</label>
			<div class="controls">
				<input type="text" id="remarks" name="remarks" value="${childBaseinfoTemp.remarks}" class="span10" />
			</div>
	   </div>
   </div>
		
	<div class="form-actions">
		<button id="btnSubmit" class="btn btn-primary" type="submit" >保存</button>
		<button id="btnReset" class="btn" type="button">重置</button>
		<!-- <button id="btnCancel" class="btn" type="button" onclick="history.go(-1)">返回</button> -->
		<button id="btnClose" class="btn" type="button" onclick="history.go(-1)">关闭</button>
	</div>
	</div>
	</form:form>
</body>
</html>